package com.maple.soa;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class TcpClient01 {

    public static void main(String[] args) throws IOException {
        InetAddress inetAddress = InetAddress.getByName("127.0.0.1");
        Socket socket = new Socket(inetAddress, 8081);

        OutputStream os = socket.getOutputStream();
        os.write("您好，网络编程。".getBytes());

        os.close();
        socket.close();
    }
}
